package com.zws.cucumber.util.colorfullog;

import org.apache.commons.lang3.tuple.Pair;

public final class ZwsRenderableStringSegment {

    private String origin;
    private int start; // inclusive
    private int end; // exclusive

    public ZwsRenderableStringSegment(String origin, Pair<Integer, Integer> offsets) {
        this(origin, offsets.getLeft(), offsets.getRight());
    }

    public ZwsRenderableStringSegment(String origin, int start, int end) {
        this.origin = origin;
        this.start = start;
        this.end = end;
    }

    public void render(StringBuilder buf) {
        buf.append(origin, start, end);
    }

    public void render(StringBuffer buf) {
        buf.append(origin, start, end);
    }

}
